

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script type="text/javascript" src="helpman_topicinit.js"></script>

<title>MDGMerge [Enterprise Architect User Guide]</title>

<meta name="keywords" content="Enterprise Architect, Sparx Systems, UML, Add-In Model,Add-In Model MDG Events, MDG_Merge,MDG Add-Ins,MDG Add-Ins MDG_Merge,MDG Events,MDG Events MDG_Merge,MDG_Merge,MDG_Merge Add-In Model">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />

<link type="text/css" href="default.css" rel="stylesheet" />
<style type="text/css">
  A, A:Visited
  {
    color: #00F;
  }

  A:Active, A:Hover
  {
    color: #F00;
  }

  OL
  {
    margin: 5px 0 5px 48px;
  }

  UL
  {
    margin-bottom: 3px;
    margin-top: 0;
  }

  #nsr
  {
    background-color: #D4DFFF;
  }

  #nsr A
  {
    text-decoration: none;
  }

  #mainbody
  {
    padding: 8px;
  }

  .p_BodyText
  {
    padding: 5px 0;
  }
</style>



<style type="text/css" media="screen">
  BODY
  {
    background-color: #FFFFFF;
  }

  #nsr
  {
    padding: 6px 6px 0 6px;
    border-bottom: none;
    vertical-align: top;
    z-index: 2;
    visibility: visible;
    left: 0;
    top: 0;
    position: absolute;
  }

  #mainbody
  {
    left: 0;
    top: 0;
    margin: 0;
    position: absolute;
    padding: 10px;
    overflow: auto;
    height: 100%;
    z-index: 1;
    background-repeat: no-repeat;
    background-position: bottom right;
    background-attachment: fixed;
  }
</style>

<style type="text/css" media="print">
  #nsr
  {
    visibility: none;
  }

  #mainbody
  {
    overflow: visible;
  }
</style>
<script type="text/javascript" language="JavaScript" src="nonscroll.js"></script>

</head>
<body scroll="no">

<div id="page">



        <div id="content">
          <div id="content-inner">
          



  
          <div id="nsr">
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
              <tr valign="top">
                <td align="left">
  


                  <p class="p_Heading1"><span class="f_Heading1">MDG_Merge</span></p>



  
                </td>
                <td align="right">
                  <a href="introduction.htm" onmouseover="document.images.main.src='button_main_h.gif'" onmouseout="document.images.main.src='button_main.gif'">
                    <img name="main" src="button_main.gif" border=0 alt="Return to Introduction">
                  </a>&nbsp;
    
                  <a href="mdgadd_insgetproperty.htm" onmouseover="document.images.prev.src='button_prev_h.gif'" onmouseout="document.images.prev.src='button_prev.gif'">
                    <img name=prev src="button_prev.gif" border=0 alt="Previous page" />
                  </a>&nbsp;
    
    
    
                  <a href="mdgadd_insnewclass.htm" onmouseover="document.images.next.src='button_next_h.gif'" onmouseout="document.images.next.src='button_next.gif'">
                    <img name=next src="button_next.gif" border=0 alt="Next page" />
                  </a>
    
    
                </td>
              </tr>
            </table>
          </div>
          <div id="mainbody">
  


                <p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Details</span></p>
<p class="p_BodyText"><span class="f_BodyText" style="font-style: italic;">MDG_Merge</span><span class="f_BodyText"> enables the Add-In to jointly handle changes to both the model branch and the code project that the model branch is connected to. This event should be called whenever the user has asked to merge their model branch with its connected code project, or whenever the user has established a new connection to a code project. The purpose of this event is to enable the Add-In to interact with the user to perform a merge between the model branch and the connected project.</span></p>
<p class="p_BodyText"><span class="f_BodyText">Also look at </span><span class="f_BodyText" style="font-style: italic;"><a href="mdgadd_insmdgconnect.htm">MDG_Connect</a>, <a href="mdgadd_insmdgpremerge.htm">MDG_PreMerge</a></span><span class="f_BodyText"> and </span><span class="f_BodyText" style="font-style: italic;"><a href="mdgadd_insmdgpostmerge.htm">MDG_PostMerge</a></span><span class="f_BodyText">.</span></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Syntax</span></p>
<p class="p_BodyText"><span class="f_BodyText" style="font-style: italic; font-weight: bold;">Function </span><span class="f_BodyText" style="font-weight: bold;">MDG_Merge</span><span class="f_BodyText" style="font-style: italic; font-weight: bold;">(Repository As EA.Repository, PackageGuid As String, SynchObjects As Variant, SynchType As String, ExportObjects As Variant, ExportFiles As Variant, ImportFiles As Variant, IgnoreLocked As String, Language As String) As Long</span></p>
<p class="p_BodyText"><span class="f_BodyText">The </span><span class="f_BodyText" style="font-style: italic;">MDG_Merge</span><span class="f_BodyText"> function syntax contains the following elements:</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 5px 0px 5px 13px;"><table cellspacing="0" cellpadding="0" border="0" style="border: none; border-spacing:0px; border-collapse: collapse;">
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="104" bgcolor="#e3e6ed" style="width:104px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Parameter</span></p>
</td>
<td valign="top" width="94" bgcolor="#e3e6ed" style="width:94px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Type</span></p>
</td>
<td valign="top" width="70" bgcolor="#e3e6ed" style="width:70px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Direction</span></p>
</td>
<td valign="top" width="434" bgcolor="#e3e6ed" style="width:434px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Description</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="104" style="width:104px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">ExportFiles</span></p>
</td>
<td valign="top" width="94" style="width:94px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-style: italic;">Variant</span></p>
</td>
<td valign="top" width="70" style="width:70px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">OUT</span></p>
</td>
<td valign="top" width="434" style="width:434px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A string array containing the list of files for each model object chosen for export by the Add-In. Each entry in this array must have a corresponding entry in the </span><span class="f_Tabletext" style="font-style: italic;">ExportObjects</span><span class="f_Tabletext"> parameter at the same array index, so </span><span class="f_Tabletext" style="font-style: italic;">ExportFiles(2)</span><span class="f_Tabletext"> must contain the filename of the object by </span><span class="f_Tabletext" style="font-style: italic;">ExportObjects(2</span><span class="f_Tabletext">).</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="104" style="width:104px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">ExportObjects</span></p>
</td>
<td valign="top" width="94" style="width:94px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-style: italic;">Variant</span></p>
</td>
<td valign="top" width="70" style="width:70px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">OUT</span></p>
</td>
<td valign="top" width="434" style="width:434px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The string array containing the list of new model objects (in </span><span class="f_Tabletext" style="font-style: italic;">Object ID</span><span class="f_Tabletext"> format) to be exported by Enterprise Architect to the code project.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="104" style="width:104px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">IgnoreLocked</span></p>
</td>
<td valign="top" width="94" style="width:94px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-style: italic;">String</span></p>
</td>
<td valign="top" width="70" style="width:70px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">OUT</span></p>
</td>
<td valign="top" width="434" style="width:434px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A value indicating whether to ignore any files locked by the code project (i.e </span><span class="f_Tabletext" style="font-weight: bold;">&quot;TRUE&quot;</span><span class="f_Tabletext"> or </span><span class="f_Tabletext" style="font-weight: bold;">&quot;FALSE&quot;</span><span class="f_Tabletext">.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="104" style="width:104px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">ImportFiles</span></p>
</td>
<td valign="top" width="94" style="width:94px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-style: italic;">Variant</span></p>
</td>
<td valign="top" width="70" style="width:70px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">OUT</span></p>
</td>
<td valign="top" width="434" style="width:434px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A string array containing the list of code files made available to the code project to be newly imported to the model. Enterprise Architect imports each file listed in this array for import into the connected model branch.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="104" style="width:104px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Language</span></p>
</td>
<td valign="top" width="94" style="width:94px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-style: italic;">String</span></p>
</td>
<td valign="top" width="70" style="width:70px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">OUT</span></p>
</td>
<td valign="top" width="434" style="width:434px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The string value containing the name of the code language supported by the code project connected to the model branch.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="104" style="width:104px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">PackageGuid</span></p>
</td>
<td valign="top" width="94" style="width:94px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-style: italic;">String</span></p>
</td>
<td valign="top" width="70" style="width:70px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">IN</span></p>
</td>
<td valign="top" width="434" style="width:434px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="104" style="width:104px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Repository</span></p>
</td>
<td valign="top" width="94" style="width:94px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-style: italic;"><a href="repository3.htm">EA.Repository</a></span></p>
</td>
<td valign="top" width="70" style="width:70px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">IN</span></p>
</td>
<td valign="top" width="434" style="width:434px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">An </span><span class="f_Tabletext" style="font-style: italic;">EA.Repository</span><span class="f_Tabletext"> object representing the currently open Enterprise Architect model. Poll its members to retrieve model data and user interface status information.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="104" style="width:104px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">SynchObjects</span></p>
</td>
<td valign="top" width="94" style="width:94px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-style: italic;">Variant</span></p>
</td>
<td valign="top" width="70" style="width:70px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">OUT</span></p>
</td>
<td valign="top" width="434" style="width:434px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A string array containing a list of objects (</span><span class="f_Tabletext" style="font-style: italic;">Object ID</span><span class="f_Tabletext"> format) to be jointly synchronized between the model branch and the project. See <a href="mdgadd_insmerge.htm#OIDFormat">below</a> for the format of the Object IDs.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="104" style="width:104px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">SynchType</span></p>
</td>
<td valign="top" width="94" style="width:94px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-style: italic;">String</span></p>
</td>
<td valign="top" width="70" style="width:70px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">OUT</span></p>
</td>
<td valign="top" width="434" style="width:434px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The value determining the user-selected type of synchronization to take place. See <a href="mdgadd_insmerge.htm#Synch">below</a> for a list of valid values.</span></p>
</td>
</tr>
</table>
</div>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Return Value</span></p>
<p class="p_BodyText"><span class="f_BodyText">Return a non-zero if the merge operation completed successfully and a zero value when the operation has been unsuccessful.</span></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Merge</span></p>
<p class="p_BodyText"><span class="f_BodyText">A merge consists of three major operations:</span></p>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1" style="font-weight: bold;">Export: </span><span class="f_Bulletlist1">Where newly created model objects are exported into code and made available to the code project.</span></li>
<li><span class="f_Bulletlist1" style="font-weight: bold;">Import: </span><span class="f_Bulletlist1">Where newly created code objects, Classes and such things are imported into the model.</span></li>
<li><span class="f_Bulletlist1" style="font-weight: bold;">Synchronize: </span><span class="f_Bulletlist1">Where objects available both to the model and in code are jointly updated to reflect changes made in either the model, code project or both.</span></li>
</ul>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Synchronize Type<a name="synch"></a></span></p>
<p class="p_BodyText"><span class="f_BodyText">The </span><span class="f_BodyText" style="font-style: italic;">Synchronize</span><span class="f_BodyText"> operation can take place in one of four different ways. Each of these ways corresponds to a value returned by </span><span class="f_BodyText" style="font-style: italic;">SynchType</span><span class="f_BodyText">:</span></p>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">None: (</span><span class="f_Bulletlist1" style="font-style: italic;">SynchType</span><span class="f_Bulletlist1"> = </span><span class="f_Bulletlist1" style="font-weight: bold;">0</span><span class="f_Bulletlist1">) No synchronization is to be performed</span></li>
<li><span class="f_Bulletlist1">Forward: (SynchType = </span><span class="f_Bulletlist1" style="font-weight: bold;">1</span><span class="f_Bulletlist1">) Forward synchronization, between the model branch and the code project is to occur</span></li>
<li><span class="f_Bulletlist1">Reverse: (</span><span class="f_Bulletlist1" style="font-style: italic;">SynchType</span><span class="f_Bulletlist1"> = </span><span class="f_Bulletlist1" style="font-weight: bold;">2</span><span class="f_Bulletlist1">) Reverse synchronization, between the code project and the model branch is to occur</span></li>
<li><span class="f_Bulletlist1">Both: (</span><span class="f_Bulletlist1" style="font-style: italic;">SynchType</span><span class="f_Bulletlist1"> = </span><span class="f_Bulletlist1" style="font-weight: bold;">3</span><span class="f_Bulletlist1">) Reverse, then Forward synchronization's are to occur.</span></li>
</ul>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Object ID Format<a name="oidformat"></a></span></p>
<p class="p_BodyText"><span class="f_BodyText">Each of the Object IDs listed in the string arrays described above should be composed in the following format:</span></p>
<p class="p_Code"><span class="f_Code">(@namespace)*(#class)*($attribute|%operation|:property)*</span></p>




            </div>
          </div>
        </div>



</div>


</body>
</html>
